The invention relates to the computational evaluation of the effect of compression or expansion of spaces between words in paragraph layouts such as automatic justified paragraph layouts.
Paragraph layout in a document production application involves selection of various format parameters so as to give the paragraph a visually pleasing appearance. Format parameters that significantly affect the aesthetic quality of a paragraph include line breaks, justification, widow-orphan control, hyphenation, and paragraph shape. Particular combinations of such format parameters can cause a paragraph to have a visually unappealing appearance. It is therefore desirable to control the manner in which format parameters are applied to a paragraph to ensure that the paragraph has an optimally attractive layout.
Techniques for automated paragraph layout are described in co-pending U.S. application Ser. No. 09/670,761, entitled “Automated Paragraph Layout,” filed Sep. 27, 2000, and No. 09/799,195, entitled “Inhibiting Hyphenation Clusters In Automated Paragraph Layouts,” filed Mar. 5, 2001, both of which are incorporated here by reference. According to the described techniques, potential line layouts can be determined and analyzed against format metrics. Penalties applied to each potential line layout can be proportional to the degree to which a layout departs from or violates one or more format metrics, such as hyphenation clustering. An optimized paragraph layout can be identified by determining the line layout combination having the lowest aggregate penalty.
The manner in which lines are broken in a justified paragraph can have a particularly significant effect on the overall visual appearance of a paragraph. If in a fully justified paragraph lines are broken so that only few words occur on each line, large spaces will occur between each word to the detriment of the aesthetic quality of the paragraph. Similarly, breaking lines so that too many words occur on each line causes the spaces between each word to be unduly compressed, which likewise detracts from the aesthetic appearance of the layout.
Several techniques exist to control the manner in which lines are broken and justified. Some text layout optimization programs determine the total distance, or “shortfall,” between the last word in a potential line and the right margin and assess a justification penalty proportional to the magnitude of the shortfall. Where compression is necessary to fit a selected number of words onto a line, the total compression needed to justify the line is measured. Some programs calculate the total expansion or total compression necessary to justify a line after the line has been subject to standard degrees of space compression or expansion. For example, the total compression necessary to justify a line may be determined after the line has already been subjected to low, moderate or high space compression. With respect to another line, the program may calculate a total shortfall necessary to justify the line after the line has been subjected to a low, moderate or high degree of space expansion.